<?php

class PDOConnection extends PDO {
	
	private static $_instance;
	
	public function __construct() {
		
	}
	
	public static function getInstance() {
		if(!isset(self::$_instance)) {
			try {
				self::$_instance = new PDO('mysql:host='.__SQL_PATH.';dbname='.__SQL_DBNAME,
											__SQL_USERNAME, 
											__SQL_PASSWORD);
				self::$_instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
			} catch(PDOException $e) {
				echo $e;
			}
		}
		return self::$_instance;
	}
}